﻿//Author:Michal Sporna
//License: https://operationsneakpeek.codeplex.com/license

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace World.Classes
{
    /// <summary>
    /// 1 of the letters of
    /// the secret word
    /// </summary>
    public class Letter
    {
        #region properties
        public string LetterString;
        public Color Color;
        public bool Uncovered;
        public int[] Pos;
        public string MapCellID;

        public int IndexInWord = 0;




        #endregion

        #region METHODS

        /// <summary>
        /// default constructor
        /// </summary>
        public Letter()
        {
            try
            {
                this.LetterString = null;
                Color = Color.Red;
   
                Uncovered = false;
                Pos = null;
                MapCellID = null;
                IndexInWord = 0;



            }
            catch (Exception ex)
            {
                Util.ErrorLogging.LogError(ex);
                return;
            }
        }


        /// <summary>
        /// draw the letter
        /// </summary>
        public void Draw()
        {
            try
            {
                Util.Cache.DrawString(Util.Cache.GetFont(WorldManager.WorldConfig.LetterFontFace).FontFace, this.LetterString, new Vector2(this.Pos[0], this.Pos[1]), WorldManager.WorldConfig.SecretWordInventoryFontSize, this.Color);


            }
            catch (Exception ex)
            {
                Util.ErrorLogging.LogError(ex);
                return;
            }

        }

        /// <summary>
        /// draw the letter uncovered
        /// </summary>
        public void DrawUncovered()
        {
            try
            {
                Util.Cache.DrawString(Util.Cache.GetFont(WorldManager.WorldConfig.LetterFontFace).FontFace, this.LetterString, new Vector2(this.Pos[0], this.Pos[1]), WorldManager.WorldConfig.SecretWordInventoryFontSize, Color.DarkViolet);


            }
            catch (Exception ex)
            {
                Util.ErrorLogging.LogError(ex);
                return;
            }

        }

        #endregion

    }
}
